import 'package:flutter/material.dart';
import 'package:flutter2/colors.dart';
import 'package:flutter2/widget/base/base_container.dart';
import 'package:flutter2/widget/base/normal_text.dart';

class TipView extends StatelessWidget {
  const TipView({
    super.key,
    this.background,
    this.text,
    required this.icon,
    this.width,
    this.height,
    this.fontColor,
    this.fontSize,
    this.margin,
  });

  final Color? background;
  final String? text;
  final String icon;
  final double? width;
  final double? height;
  final Color? fontColor;
  final double? fontSize;
  final EdgeInsets? margin;

  @override
  Widget build(BuildContext context) {
    return BaseContainer(
      radius: 10,
      width: double.infinity,
      background: background ?? tipColor,
      margin: margin ?? EdgeInsets.symmetric(horizontal: 16),
      padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          BaseContainer(
            backgroundImg: icon,
            width: width,
            height: height,
          ),
          SizedBox(
            width: 5,
          ),
          Expanded(
            child: NormalText(
              text: text,
              fontColor: fontColor,
              fontSize: fontSize ?? 12,
            ),
          )
        ],
      ),
    );
  }
}
